package com.lxy.seata.service.impl;

import com.lxy.seata.dao.TStorageDao;
import com.lxy.seata.service.TStorageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author lixinyang
 * @className: TStorageServiceImpl
 * @description: TODO
 * @date 2022/05/02日  22:48
 */

@Service
@Slf4j
public class TStorageServiceImpl implements TStorageService {

    @Autowired
    private TStorageDao tStorageDao;

    @Override
    public int decrease(Long productId, Integer count) {
        log.info("库存服务减库存开始");
        int decrease = tStorageDao.decrease(productId, count);
        log.info("库存服务减库存结束");
        return decrease;
    }
}
